Refining Hygienic Macros for Modules and Separate Compilation

نویسنده

  • Matthias Blume
چکیده

Genuine differences in the treatment of identifiers in block-structured languages and those that provide qualified names for accessing components of modules or aggregate data structures invalidate some of the assumptions hygienic macro systems are based on. We will investigate how these assumptions have to be changed, and the consequences for the construction of hygienic macro expanders. Macro expansion algorithms rely on their ability to rename identifiers throughout the program. This creates difficulties when some identifiers are used to connect individually compiled program units. Therefore, it is necessary to make separate compilation aware of macro expansion and vice versa. We will show how this can be done.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Fully-parameterized, first-class modules with hygienic macros

It is possible to define a formal semantics for configuration, elaboration, linking, and evaluation of fully-parameterized first-class modules with hygienic macros, independent compilation, and code sharing. This dissertation defines such a semantics making use of explicit substitution to formalize hygienic expansion and linking. In the module system, interfaces define the static semantics of m...

متن کامل

A Theory of Hygienic Macros

Hygienic macro systems, such as Scheme’s, automatically rename variables to prevent unintentional variable capture—in short, they “just work.” Yet hygiene has never been formally presented as a specification rather than an algorithm. According to folklore, the definition of hygienic macro expansion hinges on the preservation of alphaequivalence. But the only known notion of alpha-equivalence fo...

متن کامل

Hygienic Macros for ACL2

ACL2 is a theorem prover for a purely functional subset of Common Lisp. It inherits Common Lisp’s unhygienic macros, which are used pervasively to eliminate repeated syntactic patterns. The lack of hygiene means that macros do not automatically protect their producers or consumers from accidental variable capture. This paper demonstrates how this lack of hygiene interferes with theorem proving....

متن کامل

A Higher-order Module Discipline with Separate Compilation, Dynamic Linking, and Pickling

We present a higher-order module discipline with separate compilation and concurrent dynamic linking. Based on first-order modules one can program security policies for systems that link modules from untrusted locations (e.g., Java). We introduce a pickling operation that writes persistent clones of volatile, possibly higher-order data structures on the file system. Our pickling operation respe...

متن کامل

Separate Compilation for

This paper presents the outline of a module system for the Scheme programming language in order to solve several problems commonly encountered with contemporary implementations. These problems include the lack of support for separate compilation and crossmodule type checking as well as the necessity for non-standard language extensions to aid certain compiler optimizations like open compilation...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006